<?php

namespace app\xwam\controller;

/**
 * 附件上传设置 控制器
 *
 * @since 1.0 <2017-3-24> SoChishun <14507247@qq.com> Added.
 */
class UploadSettingController extends AppbaseController {

    // 2016-4-21
    public function edit() {
        $where = array('title' => 'UploadSetting', 'conf_group' => 'UploadSetting');
        $mDict = new \app\xwam\model\UserDictModel();
        $data = $mDict->where($where)->find();
        if (!$data) {
            $mDict->add($where);
            $data = $mDict->where($where)->find();
        }
        if (!$data) {
            exit('数据库错误!');
        }
        $this->assign('data', $data);
        return view();
    }

    public function editSave() {
        $mDict = new \app\xwam\model\UserDictModel();
        $result = $mDict->saveConf();
        $this->dialogJump($result['status'], $result['info']);
    }
}
